<%@ page import="mydessertstore.domain.Order" %>
<%@ page import="java.util.List" %>
<%@ include file="../common/top.jsp"%>
<%List<Order> list = (List<Order>) session.getAttribute("orderList");
    pageContext.setAttribute("list", list);%>

<%@ page contentType="text/html;charset=UTF-8" language="java" %>

<div id="Catalog">
<%session.setAttribute("page", "listOrders");%>
<h2>我的订单</h2>

<table>
    <tr>
        <th>订单编号</th>
        <th>下单日期</th>
        <th>总价</th>
    </tr>

    <c:forEach var="order" items="${pageScope.list}">
        <tr>
            <td>
                <a href="viewOrder?orderId=${order.orderId}">${order.orderId}</a>
            </td>

            <td><fmt:formatDate value="${order.orderDate}"
                                pattern="yyyy/MM/dd hh:mm:ss" />
            </td>
            <td><fmt:formatNumber value="${order.totalPrice}"
                                  pattern="$#,##0.00" />
            </td>
        </tr>
    </c:forEach>
</table>
</div>
<br>
<br>

<%@ include file="../common/bottom.jsp"%>
